package forCreateFile;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;

public class CreateFileSchedule {
	
	private Long timeNum = null;
	
	private Timer timer = null;
	
	public CreateFileSchedule(){
		timer = new Timer();
	}

	public void start() {
		//节点连通率
		CreateFileTask task = new CreateFileTask();
		Long longDelay = 5000L;//几秒后执行
		Long period = 60000L;//执行间隔，也就是几秒钟产生一个文件
		timer.schedule(task, longDelay, period);
		timer.scheduleAtFixedRate(task, longDelay, period);
	}
	
	public void stop(){
		timer.cancel();
	}

	public Long getTimeNum() {
		return timeNum;
	}

	public void setTimeNum(Long timeNum) {
		this.timeNum = timeNum;
		
	}
}
